<?php

class Form_AdminForm extends Form_Custom_General {

    public function init() {

        $adm_firstname = $this->createElement('text', 'adm_firstname')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'First name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_firstname);

        $adm_lastname = $this->createElement('text', 'adm_lastname')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Last name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_lastname);


        $adm_companyname = $this->createElement('text', 'adm_companyname')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_companyname);

        $adm_registration_number = $this->createElement('text', 'adm_registration_number')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company Registeration number should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_registration_number);

        $adm_address = $this->createElement('textarea', 'adm_address')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company Address should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "cols" => "50", "rows" => "10"));
        $this->addElement($adm_address);

        $adm_telephone = $this->createElement('text', 'adm_telephone')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company telephone number should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_telephone);

        $adm_fax = $this->createElement('text', 'adm_fax')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company fax number should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_fax);

        $adm_mobile = $this->createElement('text', 'adm_mobile')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Company mobile number should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_mobile);


        $old_password = $this->createElement('password', 'old_password')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "20"));
        $this->addElement($old_password);

        $password = $this->createElement('password', 'adm_password')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "20"));
        $this->addElement($password);

        $confirmpassword = $this->createElement('password', 'adm_confirmpassword')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Password should not be blank.')))
                ->setAttribs(Array("size" => "20"));
        $this->addElement($confirmpassword);


        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit"));
        $this->addElement($reset);
    }

}